home *** CD-ROM | disk | FTP | other *** search
- /*
- * cookhash 2.0
- * Jörgen Grahn 1995-04-27
- *
- * generates file for random selection of cookies
- * from a fortune cookie file
- *
- * cookhash <cookiefile >hashfile
- *
- * format of the cookie file:
- *
- * comment
- * cookie
- * comment
- * cookie
- * ...
- * comment
- * cookie
- *
- * where 'comment' is a bunch of rows starting with '%%'
- *
- *
- * Compile with 'flex' and then an ANSI C compiler.
- *
- */
-
- int filepos = 0;
-
- static char verstring[] = "$" "VER: cookhash 2.0 (27.4.95)";
-
-
- %%
-
- (\%\%.*\n)+ {
- filepos += yyleng;
- printf("%06lx\n",filepos);
- }
-
- (.|\n) {
- filepos += yyleng;
- }
-
- %%
-
- main()
- {
- yylex();
-
- exit(0);
- }
-